<template>
<!-- <div>
  <div class="index">
    <CommonHeader></CommonHeader>
    <CommonAside></CommonAside>
   
    
  </div>
  <router-view></router-view>
   
</div> -->
<div class="home">
  <div class="container">
      <h1 class="title">宠宠爱</h1>
      <p class="lead"> 生活爱宠,宠爱生活,宠宠与你同在！ </p>
  </div>
</div>
</template>

<script>
  // import CommonHeader from '../components/CommonHeader'
  // import CommonAside from '../components/CommonAside'
  // export default {
  //   components: {
  //     CommonHeader,
  //     CommonAside
  //   }
  // }
  import axios from 'axios';
  export default {

     data(){
        aid:(localStorage.getItem("aId"))
        return{
            aid:localStorage.getItem("aId"),
            Admininfo:[]
        }
      },
      mounted(){
        console.log('AID:',this.aid);
        this.judge();
        this.getList();
        console.log(typeof this.aid);
      },
      methods:{
        //获取当前用户信息
        getList(){           
            axios.get("http://localhost:3000/api/admininfo")
          .then(res =>{
            console.log(res.data);
            this.Admininfo = res.data;
            console.log(this.Admininfo);
          })
        },
        judge(){
            if(!this.aid){
                this.$message({
                type:'error',
                message:'请先登录'
              })
              this.$router.push({path:'/adlog'});
            }
        }
    }
  }
</script>

<style scoped>
 .home {
  width: 100%;
  height: 100%;
  min-width: 600px;
  background: url(../assets/images/home.jpg) no-repeat;
  background-size: 100% 100%;
}
.container {
  width: 100%;
  height: 100%;
  min-width: 600px;
  box-sizing: border-box;
  padding-top: 100px;
  background-color: rgba(0, 0, 0, 0.7);
  text-align: center;
  align-items: center;
  color: white;
}
.title {
  font-family: 楷体;

  font-size: 50px;
}
.lead {
  font-family: 隶书;
  margin-top: 60px;
  font-size: 32px;
}
</style>